#include <stdio.h>

int main()
{
    int n, sum = 0;
    scanf("%d", &n);
    for (int i = 1; i < n + 1; i++)
    {
        sum += i;
    }
    printf("\'for\' result:%d\n", sum);

    sum = 0;
    int i = 1;
    while (i < n + 1)
    {
        sum += i;
        i++;
    }
    printf("\'while\' result:%d\n", sum);
}
